package com.usian.day03.gateway.filter;

import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

/**
 * @author baimugudu
 * @email 2415621370@qq.com
 * @date 2023/7/27 15:17
 */
@Component
public class MyFilter implements GlobalFilter,Ordered {
    @Override
    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
        System.out.println("==============");
        return chain.filter(exchange);
    }

    @Override
    public int getOrder() {
        System.out.println("=======order=======");
        return 0;
    }
}
